import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:short_drama/models/Invite_model.dart';
import 'package:short_drama/models/user_model.dart';
import 'package:short_drama/pages/login/login.dart';
import 'package:short_drama/pages/mine/info.dart';
import 'package:short_drama/pages/mine/invite.dart';
import 'package:short_drama/pages/mine/profit.dart';
import 'package:short_drama/pages/mine/user.dart';
import 'package:short_drama/pages/mine/verify.dart';
import 'package:short_drama/pages/mine/wallet.dart';
import 'package:short_drama/utils/colors.dart';
import 'package:short_drama/pages/widgets/dialog.dart';
import 'package:short_drama/utils/global_util.dart';
import 'package:short_drama/utils/float.dart';

class SettingPage extends StatefulWidget {
  const SettingPage({super.key});

  @override
  State<SettingPage> createState() => _PersonalCenterPageState();
}

class _PersonalCenterPageState extends State<SettingPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: ClientColors.ff0a0f12,
      appBar: AppBar(
        backgroundColor: ClientColors.ff0a0f12,
        title: Text('设置', style: TextStyle(color: Colors.white, fontSize: 18)),
        iconTheme: IconThemeData(color: Colors.white),
        centerTitle: false,
        titleSpacing: FloatConstance.navBarSpace,
        leading: IconButton(
          onPressed: () => {Get.back()},
          icon: Icon(Icons.arrow_back_ios),
        ),
        elevation: 0,
      ),
      body: Column(
        children: [
          Container(
            margin: EdgeInsets.fromLTRB(16, 20, 16, 20),
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(10),
              color: ClientColors.odffffff,
            ),
            alignment: Alignment.center,
            child: Column(
              children: [
                ListTile(
                  title: Text('隐私政策', style: TextStyle(color: Colors.white)),
                  // trailing: Image.asset(
                  //   'assets/images/icon_user_arrow.png',
                  //   width: 6,
                  //   height: 12,
                  // ),
                  onTap: () {
                    Get.to(() => InfoPage('隐私政策', 'agreement/privacy'));
                  },
                ),
                ListTile(
                  title: Text('服务协议', style: TextStyle(color: Colors.white)),
                  // trailing: Image.asset(
                  //   'assets/images/icon_user_arrow.png',
                  //   width: 6,
                  //   height: 12,
                  // ),
                  onTap: () {
                    Get.to(() => InfoPage('服务协议', 'agreement/service'));
                  },
                ),
                ListTile(
                  title: Text('服务条款', style: TextStyle(color: Colors.white)),
                  // trailing: Image.asset(
                  //   'assets/images/icon_user_arrow.png',
                  //   width: 6,
                  //   height: 12,
                  // ),
                  onTap: () {
                    Get.to(() => InfoPage('服务条款', 'agreement/clause'));
                  },
                ),
              ],
            ),
          ),
          Spacer(),
          SizedBox(
            child: Container(
              width: double.infinity,
              height: 52,
              margin: EdgeInsets.only(bottom: 30,left: 16,right: 16),
              child: TextButton(
                style: TextButton.styleFrom(
                  backgroundColor: Color(0xff0B9970),
                  foregroundColor: Colors.white,
                ),
                onPressed: () {
                  GlobalUtil.logout();
                },
                child: Text('退出登录', style: TextStyle(fontSize: 16)),
              ),
            ),
          ),
        ],
      ),
    );
  }
}
